Helpful Information
 
 
Category: MAP
Right Click Menu in IMG --> MAP --> AREA --> Coordinates

Hello there,

I am facing a tricky situation. Let me explain it :-)

I created a IMG tag with that pointing to a bitmap file.

Now i created a MAP tag and inside that did the AREA tag and defined certain coordinates that's clickable to user. User can click and inside the "onclick" i defined a JS function that gets triggered. Upto this part everything is working awesome.

The challenge now is, i want to be able to show a custom defined menu when user right click on the coordinates inside the image. How can i do that?

Left click is handled inside "onclick", but how about right click?

Is that possible to do? If yes, how?

Thanks in advance.

Right click is almost entirely taken over by browser functions, so it's pretty confusing to use it. You might consider the menu showing onmouseover, and disappearing onmouseout.

Do you have a sample code that creates a menu? I am pretty new to HTML and have no idea.

Thanks

Do you have a sample code that creates a menu? I am pretty new to HTML and have no idea.

ThanksAlas, I don't, it's not something I've needed to use. But a list type menu styled inline should work well for the HTML. The JS has to set the style to display:block;visisbilty:visble or display: none;visibility:hidden; and to position it on top of the area.

BTW, you might want to change that bitmap to a png or jpg to reduce the file size.










privacy (GDPR)